package com.jfinalbbs.module.user;

import com.jfinal.plugin.activerecord.Model;

/**
 * Created by Tomoya.
 * Copyright (c) 2016, All Rights Reserved.
 * http://jfinalbbs.com
 */
public class User extends Model<User> {

    //实例化一个User,供Controller里调用
    public static final User me = new User();

    public User login(String username, String password) {
        return super.findFirst("select * from user where username = ? and password = ?", username, password);
    }

    public User findByUsername(String username) {
        return super.findFirst("select * from user where username = ?", username);
    }

}
